#define _CRT_SECURE_NO_WARNINGS 1
#include"string.h"

using namespace str;


void test1()
{
	str::string s1("123456");
	cout << s1.c_str() << endl;

	str::string s2 = s1;
	cout << s2.c_str() << endl;

}

void test2()
{
	str::string s1("1233456789");

	//str::string::iterator it = s1.begin();
	//while (it != s1.end())
	//{
	//	cout << *it << " ";
	//	it++;
	//}
	//cout << endl;

	str::string::iterator rit = s1.rbegin()-1;
	while (rit >= s1.rend())
	{
		cout << *rit << " ";
		rit--;
	}
	cout << endl;

	//const str::string s2 = s1;
	//str::string::const_iterator cit = s2.cbegin();
	//while (cit != s2.cend())
	//{
	//	cout << *cit << " ";
	//	cit++;
	//}
	//cout << endl;
}

void test3()
{
	str::string s1("12345678");

	for (char& e : s1)
	{
		cout << e <<" ";
	}
	cout << endl;

	//cout << s1.size() << endl;

	//s1.append("xxxxxxx");
	//for (char& e : s1)
	//{
	//	cout << e << " ";
	//}
	//cout << endl;

	//s1.insert(0, 'z');
	//for (char& e : s1)
	//{
	//	cout << e << " ";
	//}
	//cout << endl;
	//s1.insert(8, 'c');
	//s1.insert(2, "xxxxx");
	//for (char& e : s1)
	//{
	//	cout << e << " ";
	//}
	//cout << endl;
	cout << s1.find("890") << endl;
}

void test4()
{
	str::string s1("123456789");
	str::string s2("023456789");

	cout << (s1 > s2) << endl;
	cout << (s1 < s2) << endl;
	cout << (s1 == s2) << endl;
	cout << (s1 != s2) << endl;
	//cout << s1[0] << endl;
	//str::string s2;
	//s1 += "ssss";
	//cout << s1 << endl;

	//str::string ret = s1.substr(); 
	//cout << ret.c_str() << endl;
}
int main()
{
	test4();
	return 0;
}